package com.ruoyi.api.service.impl;

import com.ruoyi.api.service.VehicleService;
import com.ruoyi.api.vo.Vehicle;
import com.ruoyi.vim.mapper.VehicleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VehiceleServiceImpl implements VehicleService {

    @Autowired
    private VehicleMapper vehicleMapper;

    /**
     * 添加车辆信息
     * @param vehicle
     */
    @Override
    public void add(Vehicle vehicle) {
        vehicleMapper.add(vehicle);
    }

    /**
     * 查询所有车辆信息
     * @return
     */
    @Override
    public List<Vehicle> selectAll() {
        List<Vehicle> list = vehicleMapper.selectAll();
        return list;
    }

    @Override
    public void update(String carInfo,Integer state) {
        vehicleMapper.updateByInfo(carInfo,state);
    }

    @Override
    public void delectById(Long id) {
        vehicleMapper.delectById(id);
    }

    @Override
    public Vehicle selectByCarId(String s) {
        return vehicleMapper.selectByCarId(s);
    }
}
